package topcoder;

public class MagicDiamonds {

	public long minimalTransfer(long n){
		if(n==1)
			return 1;
		if(n==3)
			return 3;
		
		boolean prime = true;
		
		for(long i = 2; i < Math.sqrt(n); i++){
			if(n % i == 0)
				prime = false;
		}
		
		if(prime == true)
			return 2;
		else
			return 1;
	}
}
